package main

import "fmt"

type matrix struct {
	arr [3][3]int
}

func (m matrix) trans() [3][3]int {

	count := 0
	for i := 0; i < 3; i++ {

		for j := 0; j < 3; j++ {

			if i != j && i < j {
				if count == 3 {
					break
				}
				tmp := m.arr[i][j]
				m.arr[i][j]  = m.arr[j][i]
				m.arr[j][i] = tmp
				count++
			}

		}

	}

	fmt.Println(m.arr)
	return m.arr
}

func main() {

	var arr [3][3]int
	
	count := 1
	for i := 1; i <= 3; i++ {
		for j := 1; j <= 3; j++ {
			arr[i-1][j-1] = count
			count++
		}
	}
	fmt.Println(arr)

	var m matrix = matrix{
		arr: arr,
	}

	m.trans()
}